function parse(gl, value) {
	value = value.trim();

	var parts = value.split("\n");

	if (parts[0].trim() != "//0" && parts[0].trim() != "/*0*/") {
		alert("Nie jest to genotyp f0. Rozpocznij genotyp od //0 lub /*0*/");
	} else {

		parts.splice(0,1);
		
		var table = [];
		table.p = [];
		table.j = [];
		table.n = [];
		table.c = [];
		
		var p = 0, j = 0, n = 0, c = 0;
		for ( var i = 0; i < parts.length; i++) {
			parts[i] = parts[i].trim();
			if (parts[i].length < 2)
			{
				continue;
			}
			
			switch (parts[i].charAt(0)) {
			case 'p':
				// alert("Part");
				table["p"][p++] = new Part(gl, parts[i]);
				break;
			case 'j':
				// alert("Joint");
				table["j"][j++] = new Joint(gl, parts[i], table.p);
				break;
			case 'n':
				// alert("Neuron");
				table["n"][n++] = new Neuron(gl, parts[i]);
				break;
			case 'c':
				// alert("Neuron Input");
				table["c"][c++] = new NeuronInput(gl, parts[i]);
				break;
			default:
				// alert("Unknown element!");
				break;
			}
			// alert('l' + i);
		}
		return table;
	}
}